package apis.article.fallback;

import apis.article.IArticleClient;
import com.heima.model.article.dtos.ApArticleCommentDto;
import com.heima.model.article.dtos.ApArticleOpenCommentDto;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.article.vos.CommentArticleVo;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.wemedia.dtos.CommentDto;
import com.heima.model.wemedia.dtos.ManageDto;
import com.heima.model.wemedia.dtos.CommentPageDto;
import com.heima.model.wemedia.dtos.StatisticsDto;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Date;

import java.util.List;

@Component
public class ArticleClientFallBack implements IArticleClient {
    @Override
    public ResponseResult saveOrUpdateArticle(ArticleDto articleDto) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR, "获取数据失败");
    }

    @Override
    public ResponseResult selectESVoById(Long id) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR, "获取数据失败");
    }

    /**
     * @param dto
     * @description: 查询上架的文章评论概览
     * @param:
     * @return: java.util.List<com.heima.model.wemedia.pojos.WmNews>
     * @author: liyong
     * @date: 2023/06/28 16:49
     */
    @Override
    public PageResponseResult pageCommentArticle(ManageDto dto) {
        PageResponseResult result = new PageResponseResult();
        result.setCode(500);
        result.setErrorMessage(AppHttpCodeEnum.SERVER_ERROR.getErrorMessage());
        return result;
    }

    /**
     * @param dto
     * @description: 修改评论开启关闭状态
     * @param: dto
     * @return: com.heima.model.common.dtos.ResponseResult
     * @author: liyong
     * @date: 2023/06/28 21:39
     */
    @Override
    public ResponseResult updateStatus(CommentDto dto) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR, "获取数据失败");
    }

    @Override
    public ResponseResult queryLikesAndConllections(Integer wmUserId, Date beginDate, Date endDate) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }

    @Override
    public PageResponseResult newPage(StatisticsDto dto) {
        return null;
    }

    @Override
    public PageResponseResult findNewsComments(@RequestBody CommentPageDto dto) {
        return (PageResponseResult) PageResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR, "获取数据失败");
    }

    @Override
    public ResponseResult<ApArticleConfig> getConfig(Long articleId) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");

    }


    @Override
    public ResponseResult findArticleComment(ApArticleCommentDto apArticleCommentDto) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }

    @Override
    public ResponseResult openComment(ApArticleOpenCommentDto apArticleOpenCommentDto) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }
}
